<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="vue.js"></script>
</head>
<body>
<div id="app">
{{fullName}} {{age}}
</div>
<script>
    var vm = new Vue({
        el:'#app',
        data:{
            firstName:'dell',
            lastName:'Lee',
            fullName:"12312",
            age:28
        },
        watch:{
            firstName:function () {
                console.log("compute")
                this.fullName=this.firstName+this.lastName
            },
            lastName:function () {
                console.log("compute")
                this.fullName=this.firstName+this.lastName
            }
        }
        // methods:{
        //     fullName:function () {
        //         console.log("compute")
        //         return this.firstName+" " +this.lastName
        //     }
        // }
        // computed:{
        //     fullName:function () {
        //         console.log("compute")
        //         return this.firstName+" " +this.lastName
        //     }
        //}

    })














</script>
</body>
</html>